using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerVisual : MonoBehaviour
{

    private const string ANIMATOR_TAG_MOVE = "Velocity";
    private const string ANIMATOR_TAG_JUMP = "Jump";

    [SerializeField]
    private Player player;

    private Animator animator;

    void Awake() {
        animator = GetComponent<Animator>();
    }
    
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        if(animator == null) return;

        animator.SetFloat(ANIMATOR_TAG_MOVE,Mathf.Abs(player.GetPlayerVelocity().x));
        animator.SetBool(ANIMATOR_TAG_JUMP,player.GetPlayerIsGround());
    }
}
